import pymysql

conn = pymysql.connect(host="localhost",port=3306,user="root",password="zxc123!!",database="test_7_11",charset="utf8")

cursor = conn.cursor()
cursor.execute("select * from emp")

print(cursor.fetchall())

cursor.close()
conn.close()
